﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YTSK.Model;

namespace YTSK.cSK.BW
{
    class Swith
    {
        public static bool HTSwitch(string cbilltype, string filename, Customer customer, Rdrecord rd,
            List<Dictionary<string, object>> l_rds,
            out string err, out string fpdm, out string fphm)
        {
            bool bret;
            switch (cbilltype)
            {
                case "增值税专用发票":
                    var makexml = new cMakeXML_ZP();
                    makexml.MakeXML(filename, customer, rd, l_rds);
                    bret = new cKP_ZP().proc(filename, out err, out fpdm, out fphm);
                    break;
                case "普通发票":
                    var makexml1 = new cMakeXML_ZP();
                    makexml1.MakeXML(filename, customer, rd, l_rds);
                    bret = new cKP_PP().proc(filename, out err, out fpdm, out fphm);
                    break;
                case "电子发票":
                    var dzp = new cMakeXML_DZP();
                    dzp.MakeXML(filename, customer, rd, l_rds);
                    bret = new cKP_DZP().proc(filename, out err, out fpdm, out fphm);
                    break;
                case "不开票":
                    err = "此单设置了[不开票]"; fphm = "";fpdm = "";
                    bret = false;
                    break;
                default:
                    bret = false;fpdm = "";fphm = "";
                    err = "暂不支持";
                    break;
            }
            return bret;
        }
    }
}
